import 'package:flutter/material.dart';
import 'package:shop/size_config.dart';

class RoundedIconBtn extends StatelessWidget {
  const RoundedIconBtn({
    Key key,
    @required this.icon,
    @required this.press,
    this.showShadow = false,
  }) : super(key: key);
  final IconData icon;
  final GestureTapCancelCallback press;
  final bool showShadow;
  @override
  Widget build(BuildContext context) {
    // return Container(
    //   height: getProportionateScreenWidth(40),
    //   width: getProportionateScreenWidth(40),
    //   decoration: BoxDecoration(
    //     shape: BoxShape.circle,
    //     boxShadow: [
    //       if (showShadow)
    //         BoxShadow(
    //           offset: Offset(0, 6),
    //           blurRadius: 10,
    //           color: Color(0xFFB0B0B0).withOpacity(0.2),
    //         ),
    //     ],
    //   ),
    //   child: FlatButton(
    //     padding: EdgeInsets.zero,
    //     color: Colors.white,
    //     shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)),
    //     onPressed: press,
    //     child: Icon(icon),
    //   ),
    // );
    return SizedBox(
      height: getProportionateScreenWidth(40),
      width: getProportionateScreenWidth(40),
      child: Container(
        height: getProportionateScreenWidth(40),
        width: getProportionateScreenWidth(40),
        decoration: BoxDecoration(
          shape: BoxShape.circle,
          color: Colors.white,
          boxShadow: [
            if (showShadow)
              BoxShadow(
                offset: Offset(0, 6),
                blurRadius: 10,
                color: Color(0xFFB0B0B0).withOpacity(0.2),
              ),
          ],
        ),
        child: ClipOval(
          child: TextButton(
            onPressed: () {},
            child: Icon(icon),
          ),
        ),
      ),
    );
  }
}
